5db533eb8c5b85c32102f813e166cb86396a5d8c,examples/voter/src/com/SyncClientVoter.java,SyncClientVoter,main,#String#,57
Before Change
thisServer = thisServer.trim();
System.out.printf("Connecting to server: '%s'\n",thisServer);
voltclient.createConnection(thisServer, 21212);
} catch (IOException e) {
e.printStackTrace();
System.exit(-1);
}
}
After Change
thisServer = thisServer.trim();
System.out.printf("Connecting to server: '%s'\n",thisServer);
int sleep = 1000;
while(true)
{
try
{
voltclient.createConnection(thisServer);
break;
} catch (IOException e) {
System.out.println("Connection failed - retrying in " + (sleep/1000) + " second(s).");
try {Thread.sleep(sleep);} catch(Exception tie){}
if (sleep < 8000)
sleep += sleep;
}